package com.xishu.entity.customer;

import com.xishu.annotation.dao.DefaultValue;
import com.xishu.annotation.dao.FieldMapping;
import com.xishu.entity.AbstractEntity;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;

/**
 * 会员优惠卷配置
 */
@Entity(name = "vip_level_ticket_config")
@Table(indexes = {@Index(columnList = "levelId")})
public class VipLevelTicketConfig extends AbstractEntity {
    @ApiModelProperty(value = "归属哪一个公司")
    private Long companyId;

    @ApiModelProperty(value = "会员等级设置")
    private Long levelId;

    @ApiModelProperty(value = "优惠卷的ID")
    private Long ticketId;

    @ApiModelProperty(value = "是否限量")
    @DefaultValue(defaultValue = "true")
    private Boolean limitNumber;

    @ApiModelProperty(value = "发送几张优惠卷")
    @DefaultValue(defaultValue = "1")
    private Integer ticketNumber;

    @ApiModelProperty(value = "是否是VIP")
    @DefaultValue(defaultValue = "false")
    private Boolean vip;

    public Boolean getVip() {
        return vip;
    }

    public void setVip(Boolean vip) {
        this.vip = vip;
    }

    @Transient
    @FieldMapping(desField = "periodTimeConfigJson", serialize = true, isObject = true)
    private PeriodTimeConfig periodTimeConfig;

    @FieldMapping(desField = "periodTimeConfig", serialize = false, genericType = "com.xishu.entity.customer.PeriodTimeConfig", isObject = true)
    @Lob
    @Column(columnDefinition = "MEDIUMTEXT")
    private String periodTimeConfigJson;

    @Transient
    @ApiModelProperty(value = "是否要查询优惠卷的名称")
    private Boolean queryTicket;

    @Transient
    @ApiModelProperty(value = "优惠卷的中文名称")
    private String ticketName_zh;

    @Transient
    @ApiModelProperty(value = "优惠卷的英文名称")
    private String ticketName_en;

    @Transient
    @ApiModelProperty(value = "优惠卷的英文名称")
    private String ticketName;

    public String getTicketName() {
        return ticketName;
    }

    public void setTicketName(String ticketName) {
        this.ticketName = ticketName;
    }

    public PeriodTimeConfig getPeriodTimeConfig() {
        return periodTimeConfig;
    }

    public void setPeriodTimeConfig(PeriodTimeConfig periodTimeConfig) {
        this.periodTimeConfig = periodTimeConfig;
    }

    public String getPeriodTimeConfigJson() {
        return periodTimeConfigJson;
    }

    public void setPeriodTimeConfigJson(String periodTimeConfigJson) {
        this.periodTimeConfigJson = periodTimeConfigJson;
    }

    public Boolean getQueryTicket() {
        return queryTicket;
    }

    public void setQueryTicket(Boolean queryTicket) {
        this.queryTicket = queryTicket;
    }

    public String getTicketName_zh() {
        return ticketName_zh;
    }

    public void setTicketName_zh(String ticketName_zh) {
        this.ticketName_zh = ticketName_zh;
    }

    public String getTicketName_en() {
        return ticketName_en;
    }

    public void setTicketName_en(String ticketName_en) {
        this.ticketName_en = ticketName_en;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public Long getLevelId() {
        return levelId;
    }

    public void setLevelId(Long levelId) {
        this.levelId = levelId;
    }

    public Long getTicketId() {
        return ticketId;
    }

    public void setTicketId(Long ticketId) {
        this.ticketId = ticketId;
    }

    public Boolean getLimitNumber() {
        return limitNumber;
    }

    public void setLimitNumber(Boolean limitNumber) {
        this.limitNumber = limitNumber;
    }

    public Integer getTicketNumber() {
        return ticketNumber;
    }

    public void setTicketNumber(Integer ticketNumber) {
        this.ticketNumber = ticketNumber;
    }

}
